Transaction Data Analysis

Loading Libraries

Reading data from the source: CSV

Basic Exploration: EDA

Data Sanity Check

Feature Engineering

New features extracted from the time column.
Convert amount in cents to dollar for readability.

Trend of Transaction Amount across Merchants

Trend of Number of Transaction

Preprocessing and caching data merchant wise for faster analysis.

The merchant transactions are filtered one merchant at a time and store in pickel file separately in the local folder.

Q1. Infer Type of Merchants

Interested in understanding payments activity to try to infer the types of merchants using Stripe. Generate assignments for each merchant.

1. Checking Store timings to label day, night or all day store.

Assumption:
Day Store timing: 6AM to 6PM
• All day stores might be online merchants, gas stations or medical stores
• Morning only store might be vegetable vendors, breakfast places, etc.
• Night store might be dinner restaurants, bars etc.

2. Calculating Median Sales for each Merchant

An idea of how huge per transactions are normally.
Electronics shops would normally have bigger amount values than grocery stores.

Tagging each merchant with tags: low, mediumLow, mediumHigh and High based on median sales.

3. Calculating number of sales for each merchant.

Answer to how many transactions were done for the merchant in the 2 years.
Electronics shops would normally have lesser number of transactions than grocery stores.

Tagging each merchant with tags: low, mediumLow, mediumHigh and High based on number of sales.

4. Understanding seasonality of the business.

Business that do very high sales during summer or few others during holiday season. Weekend sales vs Weekday sales.
a) Number of transactions in the quarter.

b) Amount of the transactions in the quarter

c) Weekend sales and Weekday sales average

Final dataframe with Merchant Attributes

Q2. Churn Calculation

1. Quaterly Merchant Churn Rate

Plot to show the churn rate and addition of new customers over the quarters

2. Monthly Merchant Churn Rate

Plot to show the churn rate and addition of new customers over the Months

Predicting Merchant Churn

Making use of the Merchant Attributes already created.

Preparing Train and Test Dataset

As the model is able to predict the merchants that churn out with a decent accuracy. Hence, we could use the model on the active merchants to see the which merchants might churn out.